//
//  AddressCell.m
//  WuJieLive
//
//  Created by 张瀚坤 on 2017/10/31.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "AddressCell.h"

@implementation AddressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.defaultBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
}

-(void)bindDataWithModel:(AddressModel *)model
{
    self.nameLabel.text = [NSString stringWithFormat:@"%@(%@)",model.consignee,model.telephone];
    self.adressLabel.text = [NSString stringWithFormat:@"%@%@",model.region_name,model.detail_address];
    if (model.is_default) {
        self.defaultBtn.selected = YES;
    }
}

- (IBAction)editAction:(UIButton *)sender {
    if (self.editBlock) {
        self.editBlock();
    }
}

- (IBAction)deleteAction:(UIButton *)sender {
    if (self.deleteBlock) {
        self.deleteBlock();
    }
}

- (IBAction)selectedAction:(UIButton *)sender {
    if (self.defaultBlock) {
        self.defaultBlock();
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
